// extract module
var connect = require('connect');

function get(path, cb) {
	return function(req, res, next) {
		if (req.method != 'GET' || req.url != path) return next();
		cb(req, res, next);
	};
}

// create and run web server
var server = connect();

//GET - /home/index
server.use(get('/home/index', function(request, response, next) {
	response.writeHead(200, {'Content-Type': 'text/html'});
	response.write('<h1>Index Page</h1>');
	response.end();
}));

// GET - /home/about
server.use(get('/home/about', function(request, response, next) {
	response.writeHead(200, {'Content-Type': 'text/html'});
	response.write('<h1>About Page</h1>');
	response.end();
}));

server.listen(52273, function() {
	console.log('Server running at http://127.0.0.1:52273');
});